// 导入：类型、接口、模块、组件、样式
import { Component, ReactElement } from "react";

import "./styled.scss";

interface Props {
  title?: string;
  left?: ReactElement;
  right?: ReactElement;
}
interface State {}
class Index extends Component<Props, State> {
  render() {
    // const [a, b] = [11,22]
    // const {data1, data2} = {data1:1,data2:2}
    // const {数据的中键:变量名, 数据的中键:变量名=默认值} = {data1:1,data2:2}
    // const {data1:a, data2:data2=6, data3:c=6} = {data1:1,data2:2}  把【data2】得数据赋值给【data2】变量
    // const {data1:a, data2=6} = {data1:1,data2:2}  把【data2】得数据赋值给【data2】变量
    const { title = "锋神电影" } = this.props;
    return (
      <div className="navBar">
        <div className="left">{this.props.left}</div>
        <div className="title">{title}</div>
        <div>{this.props.right}</div>
      </div>
    );
  }
}
export default Index;
